Skip to content

Design: Error-Lang as a Trope IR front end (trope-particularity integration)#25

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/youthful-fermat-90bhhu
Jun 23, 2026
Merged

Design: Error-Lang as a Trope IR front end (trope-particularity integration)#25
hyperpolymath merged 3 commits into
mainfrom
claude/youthful-fermat-90bhhu

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What & why

Adds one design document — docs/Trope-Particularity-Integration.adoc — proposing that Error-Lang become a second front end to the portable trope-checker (hyperpolymath/trope-checker): lowering its Echo operations and stability factors to the language-neutral Trope IR (v0.1, prevent profile) and consuming the verified verdict + witness.

Design only — no code or runtime changes. Builds on the now-merged #24 proof work and on docs/Echo-Decomposition.adoc. trope-checker, trope-particularity-workbench, and echo-types are referenced by URL only (never vendored).

The correspondence (the substance)

Both systems already sit on the echo-types graded-loss substrate; this makes that lineage operational.

  • echo_to_residue is detach — not an analogy. Echo → EchoR is Trope → FloatingQuality; echo_input is illegal on a residue precisely because a FloatingQuality node has no bearer field to project. The [Stab-Erase] once-only debit = detach's Severed (irrecoverable) loss.
  • The silent instabilities are the calculus's moral-core violation. GlobalState / RaceCondition lower to the deceptive Conflated bottom (an untagged merge of particulars) → rejected as a lowering fault under prevent. "Do not silently merge particulars" = Error-Lang's "decomposition must be visible."
  • The verdict subsumes the scalar score. max(0, 100+Σ)floor(U) ⊑ acc(output) plus a witness edge ("the operation to repair") — the same invariant-path argmin src/abi/Stability.idr already reasons about.

Honest scope (O2 is ours)

The checker proves grade composition sound; it does not certify that an Error-Lang construct lowered to detach is a detach. The doc enumerates four per-front-end lowering-correctness obligations — L-Echo / L-Grade / L-Silent / L-Floor — to be discharged with the same Idris2 discipline as src/abi/. A schema-valid worked IR document (echo_to_residue as a detach) is included.

Phasing

  • Phase 0 (now, alongside the ReScript→AffineScript port): shape the AffineScript Echo types so Echo/EchoR/echo_to_residue lower cleanly — no new runtime coupling.
  • Phases 1–3: the trope lowering backend (Echo ops first), stabilityFactor → grade + use_model, then the O2 proofs (CI-gated).

🤖 Generated with Claude Code

https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM


Generated by Claude Code

hyperpolymath and others added 2 commits June 23, 2026 15:58
The three "Safety Proofs" in src/abi/Foreign.idr (stabilityBounded,
positionalDeterministic, paradoxMonotonic) were not proofs: each fabricated
its evidence with cast ()/cast Refl over an IO action. Replace them with
genuine, self-contained Idris2 modules, machine-checked under Idris 2 v0.8.0
(no believe_me / assert_total / cast / postulate):

- Stability.idr  : stability score is bounded in [0,100] (clamp model of
                   compiler/src/Types.res calculateStability).
- Positional.idr : positional-operator behaviour is deterministic over the
                   pure model of the Zig FFI (a genuine Refl, not IO cast Refl).
- Paradox.idr    : the two threshold-gated factors are monotone; the blanket
                   "paradox detection monotonic" claim is RETRACTED -- proving
                   it honestly surfaced that scope_leakage is prime-gated and
                   therefore non-monotone (line 7 prime, line 8 not).

Foreign.idr is reduced to an honest, self-contained ABI binding layer.
Add error-lang-abi.ipkg and verification/check-proofs.sh (idris2 --check all
four modules). Rewrite PROOF-NEEDS.md to record what is proved, what is
retracted, the toolchain, and open conformance obligations.

The language's satirical "100% production-ready / formally verified"
self-presentation in README/WHITEPAPER is intentional and left intact; this
change only makes the underlying proof artifacts real and honest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM
…integration)

Adds docs/Trope-Particularity-Integration.adoc — a design (not yet implemented)
for lowering Error-Lang's Echo operations and stability factors to the
language-neutral Trope IR (hyperpolymath/trope-checker, v0.1 prevent profile)
and consuming the verified verdict + witness.

- Object/effect/grade correspondence: Echo<A,B> <-> Trope[Phi], EchoR <->
  FloatingQuality, echo/echo_to_residue/echo_input/echo_output <-> preserve/
  detach/project. echo_to_residue IS detach (bond=Severed, irrecoverable),
  matching the [Stab-Erase] debit and "decomposition must be visible".
- stabilityFactor -> grade mapping; the silent instabilities (GlobalState,
  RaceCondition) land on the deceptive Conflated bottom -> a lowering fault
  under the prevent profile.
- Verdict mapping: scalar calculateStability -> use-model floor + p-sufficient/
  p-insufficient + witness edge (the invariant-path argmin Stability.idr already
  reasons about).
- Architecture (reference, never vendor; schema is the trust boundary), the
  per-front-end O2 lowering-correctness obligations (L-Echo/L-Grade/L-Silent/
  L-Floor), and a 4-phase plan.

Builds on docs/Echo-Decomposition.adoc; references echo-types, trope-checker and
trope-particularity-workbench by URL only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM
Comment thread docs/Trope-Particularity-Integration.adoc Fixed
Comment thread docs/Trope-Particularity-Integration.adoc Fixed
Hypatia structural_drift flagged `src/idris2/` and `src/aggregate/` in the
trope-integration design as dangling references "surviving a directory rename".
Both are deliberately *external*: the trope-checker repo's Idris2 core and the
panic-attack repo's aggregate module. Reword as unambiguously external (drop the
bare `src/<dir>/` form) so the heuristic no longer reads them as internal
error-lang tree paths. No substantive content change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 23, 2026 21:10
@hyperpolymath
hyperpolymath merged commit 4766c27 into main Jun 23, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants